@tailwind base;
@tailwind components;
@tailwind utilities;

/* Auth pages should not be affected by theme */
.auth-page {
  background-color: #f9fafb !important;
  color: #111827 !important;
}


/* Theme variables */
:root {
  /* Light theme */
  --theme-bg-primary: #ffffff;
  --theme-bg-secondary: #f8fafc;
  --theme-text-primary: #1f2937;
  --theme-text-secondary: #6b7280;
  --theme-border: #e5e7eb;
  --theme-accent: #3b82f6;
  --theme-accent-hover: #2563eb;
}

[data-theme="dark"] {
  --theme-bg-primary: #111827;
  --theme-bg-secondary: #1f2937;
  --theme-text-primary: #f9fafb;
  --theme-text-secondary: #d1d5db;
  --theme-border: #374151;
  --theme-accent: #60a5fa;
  --theme-accent-hover: #3b82f6;
}

[data-theme="blue"] {
  --theme-bg-primary: #eff6ff;
  --theme-bg-secondary: #dbeafe;
  --theme-text-primary: #1e3a8a;
  --theme-text-secondary: #3b82f6;
  --theme-border: #93c5fd;
  --theme-accent: #1d4ed8;
  --theme-accent-hover: #1e40af;
}

[data-theme="green"] {
  --theme-bg-primary: #f0fdf4;
  --theme-bg-secondary: #dcfce7;
  --theme-text-primary: #166534;
  --theme-text-secondary: #16a34a;
  --theme-border: #86efac;
  --theme-accent: #15803d;
  --theme-accent-hover: #166534;
}

[data-theme="purple"] {
  --theme-bg-primary: #faf5ff;
  --theme-bg-secondary: #f3e8ff;
  --theme-text-primary: #6b21a8;
  --theme-text-secondary: #9333ea;
  --theme-border: #c4b5fd;
  --theme-accent: #7c3aed;
  --theme-accent-hover: #6d28d9;
}

/* Apply theme variables */
body {
  background-color: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme-related Tailwind classes */
.theme-bg-primary {
  background-color: var(--theme-bg-primary) !important;
}

.theme-bg-secondary {
  background-color: var(--theme-bg-secondary) !important;
}

.theme-text-primary {
  color: var(--theme-text-primary) !important;
}

.theme-text-secondary {
  color: var(--theme-text-secondary) !important;
}

.theme-border {
  border-color: var(--theme-border) !important;
}

.theme-accent {
  background-color: var(--theme-accent) !important;
}

.theme-accent-hover:hover {
  background-color: var(--theme-accent-hover) !important;
}

.theme-accent-text {
  color: var(--theme-accent) !important;
}

/* Placeholder styles */
.theme-text-primary::placeholder {
  color: var(--theme-text-secondary) !important;
}

.theme-text-secondary::placeholder {
  color: var(--theme-text-secondary) !important;
}

/* Ensure all placeholders use theme colors */
[data-theme="dark"] ::placeholder,
[data-theme="blue"] ::placeholder,
[data-theme="green"] ::placeholder,
[data-theme="purple"] ::placeholder {
  color: var(--theme-text-secondary) !important;
}

/* Override Tailwind default colors */
[data-theme="dark"] .bg-white {
  background-color: var(--theme-bg-primary) !important;
}

[data-theme="dark"] .text-gray-900 {
  color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .text-gray-600 {
  color: var(--theme-text-secondary) !important;
}

[data-theme="dark"] .border-gray-200 {
  border-color: var(--theme-border) !important;
}

[data-theme="dark"] .bg-gray-50 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="dark"] .bg-gray-100 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="dark"] .hover\:bg-gray-50:hover {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="dark"] .hover\:bg-gray-100:hover {
  background-color: var(--theme-bg-secondary) !important;
}

/* Blue theme overrides */
[data-theme="blue"] .bg-white {
  background-color: var(--theme-bg-primary) !important;
}

[data-theme="blue"] .text-gray-900 {
  color: var(--theme-text-primary) !important;
}

[data-theme="blue"] .text-gray-600 {
  color: var(--theme-text-secondary) !important;
}

[data-theme="blue"] .border-gray-200 {
  border-color: var(--theme-border) !important;
}

[data-theme="blue"] .bg-gray-50 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="blue"] .bg-gray-100 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="blue"] .hover\:bg-gray-50:hover {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="blue"] .hover\:bg-gray-100:hover {
  background-color: var(--theme-bg-secondary) !important;
}

/* Green theme overrides */
[data-theme="green"] .bg-white {
  background-color: var(--theme-bg-primary) !important;
}

[data-theme="green"] .text-gray-900 {
  color: var(--theme-text-primary) !important;
}

[data-theme="green"] .text-gray-600 {
  color: var(--theme-text-secondary) !important;
}

[data-theme="green"] .border-gray-200 {
  border-color: var(--theme-border) !important;
}

[data-theme="green"] .bg-gray-50 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="green"] .bg-gray-100 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="green"] .hover\:bg-gray-50:hover {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="green"] .hover\:bg-gray-100:hover {
  background-color: var(--theme-bg-secondary) !important;
}

/* Purple theme overrides */
[data-theme="purple"] .bg-white {
  background-color: var(--theme-bg-primary) !important;
}

[data-theme="purple"] .text-gray-900 {
  color: var(--theme-text-primary) !important;
}

[data-theme="purple"] .text-gray-600 {
  color: var(--theme-text-secondary) !important;
}

[data-theme="purple"] .border-gray-200 {
  border-color: var(--theme-border) !important;
}

[data-theme="purple"] .bg-gray-50 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="purple"] .bg-gray-100 {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="purple"] .hover\:bg-gray-50:hover {
  background-color: var(--theme-bg-secondary) !important;
}

[data-theme="purple"] .hover\:bg-gray-100:hover {
  background-color: var(--theme-bg-secondary) !important;
}

/* More comprehensive theme overrides */
[data-theme="dark"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="blue"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="green"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="purple"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Force apply theme to all elements */
[data-theme="dark"] {
  background-color: var(--theme-bg-primary) !important;
  color: var(--theme-text-primary) !important;
}

[data-theme="blue"] {
  background-color: var(--theme-bg-primary) !important;
  color: var(--theme-text-primary) !important;
}

[data-theme="green"] {
  background-color: var(--theme-bg-primary) !important;
  color: var(--theme-text-primary) !important;
}

[data-theme="purple"] {
  background-color: var(--theme-bg-primary) !important;
  color: var(--theme-text-primary) !important;
}